<html>
<head><meta charset="utf-8"><title>Feature not listed in compiler/rustc_feature · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Feature.20not.20listed.20in.20compiler.2Frustc_feature.html">Feature not listed in compiler/rustc_feature</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="222516842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Feature%20not%20listed%20in%20compiler/rustc_feature/near/222516842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Pratt <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Feature.20not.20listed.20in.20compiler.2Frustc_feature.html#222516842">(Jan 13 2021 at 00:42)</a>:</h4>
<p>Hello. I was just going to put together my first stabilization PR, but ran into a problem when following <a href="https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#stabilization-pr">the instructions</a>. One of the first steps is to move to feature from "active" to "accepted". Only one problem — the feature isn't listed. I've confirmed the feature does in fact work on nightly, so I'm not sure what's going on. The feature in question is <code>unsigned_abs</code> if it matters.</p>



<a name="222517001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Feature%20not%20listed%20in%20compiler/rustc_feature/near/222517001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Pratt <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Feature.20not.20listed.20in.20compiler.2Frustc_feature.html#222517001">(Jan 13 2021 at 00:44)</a>:</h4>
<p>Also, is this something that can be used directly in the compiler, or is this one of the things that has to wait one nightly?</p>



<a name="222517602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Feature%20not%20listed%20in%20compiler/rustc_feature/near/222517602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Feature.20not.20listed.20in.20compiler.2Frustc_feature.html#222517602">(Jan 13 2021 at 00:52)</a>:</h4>
<p><span class="user-mention" data-user-id="245610">@Jacob Pratt</span> when you say feature, do you mean a library feature, like <code>#[unstable(feature = "unsigned_abs")]</code>? Those don't need changes in the compiler</p>



<a name="222517657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Feature%20not%20listed%20in%20compiler/rustc_feature/near/222517657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Feature.20not.20listed.20in.20compiler.2Frustc_feature.html#222517657">(Jan 13 2021 at 00:53)</a>:</h4>
<p>the dev guide is a little biased towards the compiler right now but there's an outline of instructions at <a href="https://github.com/rust-lang/rustc-dev-guide/issues/932">https://github.com/rust-lang/rustc-dev-guide/issues/932</a></p>



<a name="222517675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Feature%20not%20listed%20in%20compiler/rustc_feature/near/222517675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Pratt <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Feature.20not.20listed.20in.20compiler.2Frustc_feature.html#222517675">(Jan 13 2021 at 00:53)</a>:</h4>
<p><span aria-label="face palm" class="emoji emoji-1f926" role="img" title="face palm">:face_palm:</span> duh. Thanks for pointing out the obvious haha</p>



<a name="222517742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Feature%20not%20listed%20in%20compiler/rustc_feature/near/222517742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Feature.20not.20listed.20in.20compiler.2Frustc_feature.html#222517742">(Jan 13 2021 at 00:54)</a>:</h4>
<p>nah you're good, the instructions are unhelpful</p>



<a name="222517743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Feature%20not%20listed%20in%20compiler/rustc_feature/near/222517743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Pratt <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Feature.20not.20listed.20in.20compiler.2Frustc_feature.html#222517743">(Jan 13 2021 at 00:54)</a>:</h4>
<p>I'll take a look at your PR. Presumably things are a fair amount simpler for lib changes, at least.</p>



<a name="222517969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Feature%20not%20listed%20in%20compiler/rustc_feature/near/222517969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Feature.20not.20listed.20in.20compiler.2Frustc_feature.html#222517969">(Jan 13 2021 at 00:57)</a>:</h4>
<p>I was going to say the libs stabilization docs are at <a href="https://forge.rust-lang.org/libs/maintaining-std.html#when-a-feature-is-being-stabilized">https://forge.rust-lang.org/libs/maintaining-std.html?#when-a-feature-is-being-stabilized</a>, but then realized those aren't super clear, either. <span aria-label="smile" class="emoji emoji-1f642" role="img" title="smile">:smile:</span></p>



<a name="222518009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Feature%20not%20listed%20in%20compiler/rustc_feature/near/222518009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Pratt <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Feature.20not.20listed.20in.20compiler.2Frustc_feature.html#222518009">(Jan 13 2021 at 00:57)</a>:</h4>
<p>Better than nothing! I've at least seen the <code>#[stable]</code> attributes when looking at code before.</p>



<a name="222518340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Feature%20not%20listed%20in%20compiler/rustc_feature/near/222518340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Pratt <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Feature.20not.20listed.20in.20compiler.2Frustc_feature.html#222518340">(Jan 13 2021 at 01:01)</a>:</h4>
<p>Is <code>#[rustc_const_stable]</code> always necessary, or only when it was previously not <code>const</code>?</p>



<a name="222518736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Feature%20not%20listed%20in%20compiler/rustc_feature/near/222518736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Feature.20not.20listed.20in.20compiler.2Frustc_feature.html#222518736">(Jan 13 2021 at 01:06)</a>:</h4>
<p>AFAIK the only thing that uses that is rustdoc</p>



<a name="222518761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Feature%20not%20listed%20in%20compiler/rustc_feature/near/222518761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Feature.20not.20listed.20in.20compiler.2Frustc_feature.html#222518761">(Jan 13 2021 at 01:07)</a>:</h4>
<p>if they're the same it might be nice to say it explicitly, instead of making the reader guess</p>



<a name="222518785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Feature%20not%20listed%20in%20compiler/rustc_feature/near/222518785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Pratt <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Feature.20not.20listed.20in.20compiler.2Frustc_feature.html#222518785">(Jan 13 2021 at 01:07)</a>:</h4>
<p>I was just looking through the same file, and it _looks like_ it's always required. Can't hurt to have one extra line anyways.</p>



<a name="222528896"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Feature%20not%20listed%20in%20compiler/rustc_feature/near/222528896" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Feature.20not.20listed.20in.20compiler.2Frustc_feature.html#222528896">(Jan 13 2021 at 03:37)</a>:</h4>
<p>My understanding is that <code>rustc_const_stable</code> is only used for functions that were stabilized <em>without</em> <code>const</code> and then <code>const</code> was added later. So I don't think you should add it.</p>



<a name="222528903"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Feature%20not%20listed%20in%20compiler/rustc_feature/near/222528903" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Feature.20not.20listed.20in.20compiler.2Frustc_feature.html#222528903">(Jan 13 2021 at 03:37)</a>:</h4>
<p>That said, I may be wrong :)</p>



<a name="222529109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Feature%20not%20listed%20in%20compiler/rustc_feature/near/222529109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Feature.20not.20listed.20in.20compiler.2Frustc_feature.html#222529109">(Jan 13 2021 at 03:41)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/Feature.20not.20listed.20in.20compiler.2Frustc_feature/near/222518736">said</a>:</p>
<blockquote>
<p>AFAIK the only thing that uses that is rustdoc</p>
</blockquote>
<p>Actually the compiler enforces stuff based on it. It's used just like <code>#[unstable]</code> and <code>#[stable]</code>.</p>
<p>For example, <code>std::panic::Location::caller</code> is a stable function but is not yet stable in const-context. So, this code gives an error:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">const</span><span class="w"> </span><span class="k">fn</span> <span class="nf">foo</span><span class="p">()</span><span class="w"> </span>-&gt; <span class="kp">&amp;</span><span class="o">'</span><span class="nb">static</span> <span class="nc">std</span>::<span class="n">panic</span>::<span class="n">Location</span><span class="o">&lt;'</span><span class="nb">static</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">std</span>::<span class="n">panic</span>::<span class="n">Location</span>::<span class="n">caller</span><span class="p">()</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="fm">println!</span><span class="p">(</span><span class="s">"{:?}"</span><span class="p">,</span><span class="w"> </span><span class="n">foo</span><span class="p">());</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>
<p>(<a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=208a1012df4dd238cf44e100589c52b8">Playground</a>)</p>
<p>Errors:</p>
<div class="codehilite"><pre><span></span><code>   Compiling playground v0.0.1 (/playground)
error: `Location::&lt;&#39;a&gt;::caller` is not yet stable as a const fn
 --&gt; src/main.rs:2:5
  |
2 |     std::panic::Location::caller()
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

error: could not compile `playground`

To learn more, run the command again with --verbose.
</code></pre></div>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>